﻿using AutoMapper;
using Gecko.Entities;
using Gecko.Models;
using Gecko.Models.Dto;
using Gecko.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http.Routing;

namespace Gecko
{
    public static class AutoMapperWebConfiguration
    {
        public static void Configure()
        {
            Mapper.Initialize(cfg =>
            {
                cfg.AddProfile(new UserInfoProfile());
            });
        }
    }

    public class UserInfoProfile : Profile
    {
        protected override void Configure()
        {
            Mapper.CreateMap<UserInfoDto, UserInfo>();
            Mapper.CreateMap<UserInfo, UserInfoDto>();
            Mapper.CreateMap<WaterLeak, WaterLeakDto>();
            Mapper.CreateMap<WaterLeakWithFirstResourceUrl, WaterLeakDto>();
            Mapper.CreateMap<WaterLeakWithFirstResourceUrlFull, WaterLeakFullResDto>();
            Mapper.CreateMap<WaterLeakDto, WaterLeak>();
            Mapper.CreateMap<WaterLeakResource, WaterLeakResourceDto>();
            Mapper.CreateMap<WaterLeakHistoryDto, WaterLeakHistory>();
        }
    }

    
}